package com.wise.service.cms.content.applicationarticle;

import com.wise.entities.content.ApplicationArticle;
import com.wise.framework.daomodel.DaoOne4Update;
import com.wise.framework.daomodel.DaoRemove;
import com.wise.summer.v1.cms.content.applicationarticle.DeleteApplicationArticleById;
import org.springframework.stereotype.Service;
import org.summerframework.model.SummerService;
import org.summerframework.model.SummerServiceBean;

import static com.wise.model.content.ContentErrMsgs.Err_001600250007;

/**
 * @author hejiawei
 * @date 2020/10/27 12:35
 */
@Service
@SummerService
public class DeleteApplicationArticleService implements SummerServiceBean<DeleteApplicationArticleById> {
    @Override
    public void sum(DeleteApplicationArticleById model) {
        ApplicationArticle article = DaoOne4Update.s(ApplicationArticle.class, model.getId(), Err_001600250007);

        DaoRemove.s(article);
        model.setSummerResult(true);
    }
}
